# Variable definition
ECHO = @echo
ECHOFLAGS =

RM = @rm
RMFLAGS = -f

COMP = gcc
COMPFLAGS = -Wall -Wextra -g

LINK = gcc
LINKFLAGS = -Wall -Wextra -g

BIN = Fuzzit
OBJS = Watcher.o Logger.o Launcher.o Fuzzit.o
GENERIC_HEADERS = Utils.h
LIBS =
CLEAN = clean

# Linking
$(BIN) : $(OBJS)
	$(ECHO) $(ECHOFLAGS) [+] Linking...
	$(LINK) $(LINKFLAGS) -o $(BIN) $(OBJS) $(LIBS)
	$(ECHO) $(ECHOFLAGS)

# Generic compilation of single C file
%.o : %.c %.h $(GENERIC_HEADERS)
	$(ECHO) $(ECHOFLAGS) [+] Compilation of "$@" ...
	$(COMP) $(COMPFLAGS) -c $<
	$(ECHO) $(ECHOFLAGS)

# Cleaning rule
$(CLEAN) :
	$(RM) $(RMFLAGS) $(BIN) $(OBJS) core
